import React, { lazy } from "react"
import type { RouteObject } from "react-router-dom"
import { Navigate } from "react-router-dom"

const Discover = lazy(() => import("@/views/Discover"))
const NewDisc = lazy(() => import("@/views/Discover/c-views/NewDisc"))
const Radio = lazy(() => import("@/views/Discover/c-views/Radio"))
const Ranking = lazy(() => import("@/views/Discover/c-views/Ranking"))
const Recommend = lazy(() => import("@/views/Discover/c-views/Recommend"))
const Singer = lazy(() => import("@/views/Discover/c-views/Singer"))
const Soogs = lazy(() => import("@/views/Discover/c-views/Soogs"))
const Download = lazy(() => import("@/views/Download"))
const MyMusic = lazy(() => import("@/views/MyMusic"))
const Foucs = lazy(() => import("@/views/Foucs"))

const routes: RouteObject[] = [
	{
		path: "/",
		element: <Navigate to="/discover" />,
	},
	{
		path: "/discover",
		element: <Discover />,
		children: [
			{
				path: "/discover",
				element: <Navigate to="/discover/recommend" />,
			},
			{
				path: "recommend",
				element: <Recommend />,
			},
			{
				path: "ranking",
				element: <Ranking />,
			},
			{
				path: "songs",
				element: <Soogs />,
			},
			{
				path: "radio",
				element: <Radio />,
			},
			{
				path: "singer",
				element: <Singer />,
			},
			{
				path: "newdisc",
				element: <NewDisc />,
			},
		],
	},
	{
		path: "/download",
		element: <Download />,
	},
	{
		path: "/my",
		element: <MyMusic />,
	},
	{
		path: "/foucs",
		element: <Foucs />,
	},
]
export default routes
